<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:a="http://richfaces.org/a4j" template="/layout/bookingTemplate.xhtml">
	<ui:define name="subCenter">
		<c:set value="#{ticketBooking.departTicketDTO}" var="departTDO"/>
		<c:set value="#{ticketBooking.returnTicketDTO}" var="returnDTO"/>
		<h:outputText value="#{bookingmsgs['booking.ticketDetail.title']}" styleClass="itinerary"/>
		<h:panelGrid id="pnlGridTicketDetailTitle" columns="2"
			columnClasses="titleCol1, sumCol2" styleClass="personInfo">
			<h:outputText value="#{bookingmsgs['booking.ticketDetail.ticket']}" />
			<h:panelGroup>
				<h:outputText value="#{ticketBooking.getSum()}"/>
				<h:outputText value=" VND" />
			</h:panelGroup>
		</h:panelGrid>

		<h:panelGrid columns="6" style="width: 100%;"
			columnClasses="ticketDetailCol1, ticketDetailCol2, ticketDetailCol3, ticketDetailCol4, ticketDetailCol5, ticketDetailCol6">
			<ui:remove>Depart information</ui:remove>
			<h:graphicImage value="/img/logo.png" />
			<h:panelGroup>
				<h:outputText value="#{bookingmsgs['booking.ticketDetail.departTime']}" styleClass="boldStyle"/>
				<h:outputText value="#{departTDO.departTime}" />
				<br />
				<h:outputText value="#{bookingmsgs['booking.ticketDetail.arriveTime']}" styleClass="boldStyle"/>
				<h:outputText value="#{departTDO.arriveTime}" />
			</h:panelGroup>
			<h:panelGroup>
				<h:outputText value="#{departTDO.departDayAndDate}, #{departTDO.from}(#{departTDO.fromCode}) " />
				<br />
				<h:outputText value="#{departTDO.arriveDayAndDate}, #{departTDO.to}(#{departTDO.toCode}) " />
			</h:panelGroup>
			<h:panelGroup>
				<h:outputText value="Vietnam Airlines" styleClass="boldStyle"/>
				<br />
				<h:outputText value="#{ticketBooking.selectedDepartTicketTypeOnDetail}" />
				<br />
				<h:outputText value="#{departTDO.plane}" />
			</h:panelGroup>
			<h:panelGroup>
				<h:outputText value="#{bookingmsgs['booking.ticketDetail.price']}"/>
				<br/>
				<h:outputText value="VAT(#{ticketBooking.vatRate}):"/>
			</h:panelGroup>
			<h:panelGroup>
				<h:outputText value="#{ticketBooking.departPrice}"/>
				<br/>
				<h:outputText value="#{ticketBooking.departVat}"/>
			</h:panelGroup>
			
			<rich:spacer height="5px"/>
			<rich:spacer height="5px"/>
			<rich:spacer height="5px"/>
			<rich:spacer height="5px"/>
			<rich:spacer height="5px"/>
			<rich:spacer height="5px"/>
			<ui:remove>Return information</ui:remove>
			<h:graphicImage value="/img/logo.png" rendered="#{ticketBooking.isRoundTrip()}"/>
			<h:panelGroup rendered="#{ticketBooking.isRoundTrip()}">
				<h:outputText value="#{bookingmsgs['booking.ticketDetail.departTime']}" styleClass="boldStyle"/>
				<h:outputText value="#{returnDTO.departTime}" style="padding-left: 10px;"/>
				<br />
				<h:outputText value="#{bookingmsgs['booking.ticketDetail.arriveTime']}" styleClass="boldStyle"/>
				<h:outputText value="#{returnDTO.arriveTime}" style="padding-left: 10px;"/>
			</h:panelGroup>
			<h:panelGroup rendered="#{ticketBooking.isRoundTrip()}">
				<h:outputText value="#{returnDTO.departDayAndDate}, #{returnDTO.from}(#{returnDTO.fromCode}) " />
				<br />
				<h:outputText value="#{returnDTO.arriveDayAndDate}, #{returnDTO.to}(#{returnDTO.toCode}) " />
			</h:panelGroup>
			<h:panelGroup rendered="#{ticketBooking.isRoundTrip()}">
				<h:outputText value="Vietnam Airlines" styleClass="boldStyle"/>
				<br />
				<h:outputText value="#{ticketBooking.selectedReturnTicketTypeOnDetail}" />
				<br />
				<h:outputText value="#{returnDTO.plane}" />
			</h:panelGroup>
			<h:panelGroup>
				<h:outputText value="#{bookingmsgs['booking.ticketDetail.price']}"/>
				<br/>
				<h:outputText value="VAT(#{ticketBooking.vatRate}):"/>
			</h:panelGroup>
			<h:panelGroup>
				<h:outputText value="#{ticketBooking.returnPrice}"/>
				<br/>
				<h:outputText value="#{ticketBooking.returnVat}"/>
			</h:panelGroup>
		</h:panelGrid>
		
		<table width="100%" border="1">
			<tr></tr>
		</table>
		
		<h:panelGrid id="total" columns="3" style="width: 100%;"
			columnClasses="totalCol1, totalCol2, totalCol3">
			<h:outputText value="#{bookingmsgs['booking.ticketDetail.sum']}" />
			<rich:spacer />
			<rich:spacer />
			

			<rich:spacer />
			<h:outputText value="#{bookingmsgs['booking.ticketDetail.vat']}(#{ticketBooking.vatRate})" />
			<h:outputText value="#{ticketBooking.vatSum}" />
			<rich:spacer />
			<h:outputText
				value="#{bookingmsgs['booking.ticketDetail.serviceFee']}" />
			<h:outputText value="#{ticketBooking.serviceFee}" />
		</h:panelGrid>
		<h:form id="frmTicketDetail">
			<h:panelGrid style="width: 100%; text-align: right;">
				<h:commandButton action="#{ticketBooking.book()}"
					value="#{bookingmsgs['booking.ticketDetail.book']}"
					style="color: blue; font-weight: bold; font-size: 13px;" />
			</h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>